﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">

        //String
        /*
        var str1 = new String("abc,123,def");
        var str2 = new String("abc");

        //        if (str1.toString() == str2.toString()) {
        //            str +=("真");
        //        }
        //        else {
        //            str +=("假");
        //        }

        //str +=(str1.indexOf("123"));
        //str +=(str1.replace("123", "jjj"));
        //str +=(str1.slice(0,3));
        //str +=(str1.substring(3,6) + "<br/>");
        //str +=(str1.substr(3, 3));

        var arr = str1.split(",");

        for (var i = 0; i < arr.length; i++) {
            str +=ln(arr[i]);
        }
        */
        /*
        function ShowDateTime() {
            //alert("Test");
            var date = new Date(1999,9 - 1,10);
            var str;
            str = (date + "<br/>");
            str += (date.getYear() + "<br/>");
            str +=(date.getMonth() + 1 + "<br/>");
            str +=(date.getDate() + "<br/>");

            str +=(date.getHours() + "<br/>");
            str +=(date.getMinutes() + "<br/>");
            str += (date.getSeconds() + "<br/>");

            document.getElementById('txtShow').value = str;
            //document.write("abc");
        }
        //ShowDateTime();
        //window.setInterval(ShowDateTime, 1000);
        setTimeout(ShowDateTime, 1000);
        */

        //Math


        /*

        document.write(Math.abs(-99) + "<br/>");
        for (var i = 0; i < 10; i++) {
            document.write(parseInt(Math.random() * 10) + "<br/>");
        }

        document.write(Math.round(99.856) + "<br/>");

        document.write(Math.floor(4.5) + "<br/>");
        document.write(Math.ceil(4.5) + "<br/>");
        */

        var str = "abc123def789hij";

        var re = new RegExp("[0-9]", "g");
        //var re = /[0-9]/g;
        document.write(typeof (re));

        var arr = str.match(re);

        document.write(arr.length + "<br/>");

        for (var i = 0; i < arr.length; i++) {
            document.write(arr[i]);
        }

    </script>
</head>
<body>
<input id="txtShow" style="width:100%;" type="text" />

</body>
</html>
